<?php
    //echo $this->Html->css(array('fullcalendar.css', 'jquery-ui-1.8.9.custom.css', 'screen.css', 'ie.css'),'stylesheet', array('media'=>'screen'));
	//echo $this->Html->script(array('jquery-1.4.4.min.js', 'jquery-ui-1.8.9.custom.min.js', 'fullcalendar.min.js', 'gcal.js'));
?>


<?php
	//pr($felist);
?>

<div class="main-content grid_7 alpha">
                        <header>
                            <ul class="action-buttons clearfix fr">
                                <li><a href="../jobs/jview" class="button button-gray no-text" title="View the Task Calendar">Task Calendar<span class="calendar"></span></a></li>
                                <li><a href="documentation/index.html" class="button button-gray no-text help" rel="#overlay">Help<span class="help"></span></a></li>
                            </ul>
                            <div class="view-switcher">
                                <h2>My Previous Tasks<a href="#">&darr;</a></h2>
                                <?php echo $this->element('taskmenu');?>
                            </div>
                        </header>

                        <section>
                            <ul class="listing list-view">
                                <?php
                                //echo print_r($_SESSION);
                                //echo pr($felist);
                                $today = date("Y-m-d H:i");
                                //print_r($today);
                                foreach($felist as $task)
                                {

                                //if ($task['Job']['sdate'] == $today) {
//                                echo
//                                '<li class="tick" id="' . $task['Job']['id'] . '">
//                                    <a class="more" href="../jobs/jdetail/' . $task['Job']['id'] . '">&raquo;</a>
//                                    <span class="timestamp">' . $task['Job']['sdate'] . '</span>
//                                    <a href="../jobs/jdetail/' . $task['Job']['id'] . '">Today</a>
//                                    <p>' . $task['Job']['title'] . '</p>
//                                </li>';
//                                    }
                                if($task['Job']['sdate'] < $today) {
                                    echo
                                        '<li class="tick" id="' . $task['Job']['id'] . '">
                                            <table style="width:100%;">
                                                <tr>
                                                    <th style="width:50%; text-align:left;">
                                                        <a class="more" href="../jobs/jdetail/' . $task['Job']['id'] . '">&raquo;</a>
                                                        <a href="../jobs/jdetail/' . $task['Job']['id'] . '">' . $task['Job']['title'] . '</a>
                                                    </th>
                                                    <th style="width:50%;">
                                                        <span class="timestamp">' . $task['Job']['sdate'] . '</span>
                                                    </th>
                                                </tr>
                                                <tr>
                                                    <td>    
                                                        <p>Hours Volunteered: <b>' . $task['Job']['volhours'] . '</b></p>
                                                    </td>
                                                    <td style="float:right;">'
                                                        . $form->button('<span class="icon-note"></span>Task Notes', array('class' => 'button button-gray accept', 'onclick' => 'location.href=\'' . $this->Html->url('/jobs/jaddnote/'.$task['Job']['id']) . '\'' , 'type' => 'button')) . '
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        Task Notes: ' . $task['Job']['volnotes'] . '
                                                    </td>
                                                <tr>
                                            </table>
                                        </li>';
                                    }
                                }
                                ?>

                            </ul>
                            
                        </section>
                    </div>
                   
        



            